As Barry said you only need a valid token on connection, but if you’re hosting your bot on an unstable server that doesn’t have a reliable connection you can just automate the process at regular intervals.
If you stagger the refreshing of tokens you can spread them out to the degree where you never have a burst of renewals and the overhead is insignificant. 10,000 API requests spread over a 4 hour period is a negligible amount of requests so if you want to maintain token validity 100% of the time rather than waiting until connection to test validity and refresh if needed that’s entirely possible.