UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e/no9SW8YnGF9RP/8t4SnQToWBxxxgYGuRsed2nIbTQ='
WHERE
key_id = '9302deca4a87c85823614d851a8ec7d31a2929234dc7002f103c27a41da56a9b'
AND (
token = 'e/no9SW8YnGF9RP/8t4SnQToWBxxxgYGuRsed2nIbTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)