Use lua-shoco to compress tokens before storing and querying, and uncompress them when returning them if necessary.