UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Y9DfUf0F3JqEY45Iz03G1OuCIT2svqc69bJvYem7Qo='
WHERE
key_id = '9e04feddafb5c1ddf9f70c20b003de27776bc6befc45b89658f4f5af7fc1727b'
AND (
token = '2Y9DfUf0F3JqEY45Iz03G1OuCIT2svqc69bJvYem7Qo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)