Updating to include locking for refreshing the token