How to update collection variable when a scheduled run occurs?

Hey there, so my API requires an access token and it needs to be refreshed every hour. So I set a scheduled run for it. However, it doesn’t update the variable. I’ve tried this with collection, global and environment variables and nothing seems to work. Here’s the code I used. It prints the correct stuff to console but just wouldn’t update the variable.

let responseBodyJSON = pm.response.json();

///pm.environment.set(“access_token”, responseBodyJSON.access_token);

pm.collectionVariables.set(“authtoken”, responseBodyJSON.access_token);
console.log("Access token: " + pm.collectionVariables.get(“authtoken”));