How can I auto refresh OAuth 2.0 token once the token expires.?

I guess you could lower the expires in time in the environment variable so that it refreshes sooner?

The decision to run the token creation again would be based on comparing the time now to the time set to expire.