Generating a token/uuid every specific amount of time

I am trying to generate access tokens for my application that are refreshed let’s say (every 10 minutes). After that period a new authorisation should be made. (like oAuth)

Although, the point here is to create an UUID and make it last for a specific amount of time?

In my mind this could work by having the actual timestamp and applying a logic on top of that which will be refreshed after a specific amount of time?

Hopefully the question is not too confusing.

With the purpose of having an answer to the question. this is just a copy from @PeterLyons comment which nailed the question properly.

Token npm package does all the job with a really simple configuration.

https://www.npmjs.org/package/token