I'd suggest you, creating a Custom Setting for it. Create three fields, Access Token, Refresh Token & expiry time. Before making a callout to the external service, check whether the token you already have in your custom setting is expired or not. If the token has expired, make Callout to the external web service & request a refresh token else use the one, you've stored.
The idea would be similar to this.
@AuraEnabled public static String validateAuthToken_Apex(){
GDrive__c gdAuth = new GDrive__c(); //custom setting
gdAuth = GDrive__c.getorgDefaults();
if(gdAuth != null){
DateTime curTime = System.now();
if(gdAuth.Access_Token__c == '' || gdAuth.Access_Token__c == null){
//inserts access token & set expiry time of token
return 'required';
}
else{
if(curTime < gdAuth.Expires_at__c){
//Token isnt expired
return 'notrequired';
}
else{
///Request refresh token
Boolean response = getRefreshToken_Apex(gdAuth);
if(response){
return 'refreshed';
}
else{
return 'some error';
}
}
}
}
else{
return 'false';
}
}
And while populating the access token or the refresh token in custom settings, populate Expiry time current time + 3600 seconds (as you mentioned the expiry duration)
gdAuth.Expires_at__c = System.now().addSeconds(Integer.ValueOf(gdAuthResp.get('expires_in')));