Usually, token validity is set by the customer's Entra configuration.
We are not sure what is causing the variability instead of just always exactly 24:00:00. Opening a support ticket might be helpful here.
Regardless, if your system looks into the token to check the expiration, and starts renewal some time before it expires, there shouldn't be any problem with this variability.
It is not expected that token renewal will fail, but there could be network glitches or another unforeseen situation that might cause this. Renewing the token in advance, seems like a reasonable precaution to take.
We are moving towards Entra authentication more and more, and new cache creation in Portal is already defaulting to Entra ON and Access Keys OFF. So, we will encourage customers to move to Entra as it is more secure and definitely the authentication method of preference going forward.
Regards,
Oury