I'm considering a scenario where a user installs the app on multiple devices say mobile and desktop; and generates two different tokens.
My current plan is to store both the tokens for the user in database. However, I'm not sure how do I handle the scenario when the token is expired and a new token is generated?
For example, this could be the simple db structure -
id | user_id | token
-------------------------
1 | 1 | asdlgkj090sdf8q (desktop)
2 | 1 | zlkroqiuoiquoio (mobile)
3 | 2 | mnnjnjnjnjojuhq
4 | 2 | 498slkdsflksjfl
If the token for mobile gets updated; I've no way of knowing which row to update.
How do I handle such scenario?