If you just run a single process on a schedule then you never have to worry about threads. Doing it that way just complicates things. Run a background process that manages tokens and then only worry about reading the active access token from the DB…no threads involved.
Using this, I’ve never once, across many projects, ever had a single failure.