The standard authentication mechanism isn’t fully compatible with custom middleware authentication, I would suggest you take a look at the documentation that’s available here, basically:
a) If you’re using a gRPC plugin it’s not possible to interact with Redis directly (at least not through Tyk, so you wouldn’t be able to check for existing keys this way).
b) The custom middleware authentication will require you to implement your own token validation function and create your own session objects, see this sample.