Token expires after 15minutes

The Access Token lasts for 15 minutes, the river runs for 15minutes and then stops which is affecting in pulling the data. The source said that we have to generate a new access token either before every API call or within 15 minutes for the next API call in order for the API call to be validated.
What’s the solution for this, please let me know.