UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E858DP2Zv7fFQ0wC/jh4AMQd+n6QwEO2oM1Mjz/+B/s='
WHERE
key_id = 'e9d99cef5197dad9d74da5203ea6d96e5e5adb8c0128668051e81b012cd25753'
AND (
token = 'E858DP2Zv7fFQ0wC/jh4AMQd+n6QwEO2oM1Mjz/+B/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)