How do you do it without the service going into some sort of a database to check if there's a certain time for which all tokens older than it should be invalidated?
If you stick to OAuth and OIDC you have the option to validate the tokens against the userinfo and introspect endpoints, but that's, just another "database"