Best practice to refresh the app access token

Create a central system for key management. So your threads load the key from, say redis (or your DB), and don’t renew the key itself, your threads load the key to use from redis, and you create a separate service to manage keys.

So your threads will never call the app access generation themselves.