UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7BwD8q3eoVzDXFgIKuUM7T/Gpb0SiYMFVWQcSAfAtDE='
WHERE
key_id = 'cf56cf214fd6b8d543c4783bd7424a477d62ba0ba75d0ee3464e3a04c8b0ba74'
AND (
token = '7BwD8q3eoVzDXFgIKuUM7T/Gpb0SiYMFVWQcSAfAtDE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)