UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'stbIQYi29p9HlnMcK6i9EsRZ3TkNGEpLCCaYHYUunzU='
WHERE
key_id = 'ab698de5688775b3d60b788aaf2a07bbf35bdda42b13e0855a7aa364ffb76ced'
AND (
token = 'stbIQYi29p9HlnMcK6i9EsRZ3TkNGEpLCCaYHYUunzU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)