I imagine there should be an endpoint where you can check or refresh your token. You can do this step when the user starts or resume their session.
Otherwise, you can wait until a 401 or similar error happens and proceed to refresh the token and resume the original request.