Your should generate and store the token using a cron script
Store the token in a database/flat file/something.
Then your website/whatever will load the token from the database/flat file/something and use it as needed.
Saves wasting a cURL call to generate/check a token each time if you have a separate service managing it