The expires_in field you get given with your access token is in seconds, not milliseconds. App Access Tokens last between 50 and 70 days usually.
Usually there is no need to get a new token until hours, or a day, before it expires.
One option is to check the Validate Token endpoint https://dev.twitch.tv/docs/authentication#validating-requests once a day, and check how much time is left on the token, if it’s less than a day you should get a new one.
Alternatively you can just calculate when the token is set to expire based off of the expires_in when you get the token, and then just regularly compare the current time to the expiration time, and that way you wont need to send a request to the Validate Token endpoint.