UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xaHr253fJRpg/TOVuZmRPg2iA05BNl9C0JjSYpSrT9Y='
WHERE
key_id = 'c0daaf36b535fd5516d7f1a6f33f6fa08b8a7b7e11c3d4d09e2a11a211bb423c'
AND (
token = 'xaHr253fJRpg/TOVuZmRPg2iA05BNl9C0JjSYpSrT9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)