UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f0cj4c0r4/IEQpUBwm8iYAyvU9aPQ1NY+fHoRDQHX0E='
WHERE
key_id = '1a02476764cf8ea97c12ffab2411ba006b5f0636a7af6accbee6d934bcc7f9f7'
AND (
token = 'f0cj4c0r4/IEQpUBwm8iYAyvU9aPQ1NY+fHoRDQHX0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)