Backported a fix from Master into Grizzly.

This commit has been made to place indexing on the valid token column.
Backport fix from Master into Grizzly

This commit adds indexing for expired tokens.