Check if a refresh of the token is needed

def _requires_refresh_token(self):
        """
        Check if a refresh of the token is needed
        """
        expires_on = datetime.datetime.strptime(
            self.login_data['token']['expiresOn'], '%Y-%m-%dT%H:%M:%SZ')
        refresh = datetime.datetime.utcnow() + datetime.timedelta(seconds=30)
        return expires_on < refresh