How would you handle caching tokens in an external database so that the process can survive restarts without having to request a new token every time?