can we use XOR enc to store data in the string itself to optimize the DB queries?
Yes, but it will no longer be called a token, but rather a ticket (if using a symmetric encryption) or certificate (if using symmetric encryption). Like tokens, tickets and certificates are string used for authentication, but they actually contain encrypted and/or cryptographically signed data, rather than just a random number.
The server issues a ticket/certificate, encrypting any authentication details like who the user is, and their permissions, a timestamp and validity period, and possibly a salt. To authenticate, the server decrypts the ticket/certificate and validates these values. Tickets and certificates are often used in distributed authentication without a central server or where the central server may be unreachable from the application.
Tickets and certificates are more difficult to implement securely, compared to tokens; but due to their decentralized nature, they can scale better and be usable in situations where central authentication isn't possible.
I would, however, recommend something more specific than XOR encryption. While XOR is a part of many stream cipher, the hard part in doing XOR encryption is generating the pseudo random stream that you used to XOR to the data.