UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0KSsOBm8HPB1g912zXjj19tTVTzUw98mEFocuTeka00='
WHERE
key_id = '8126e03a0967b3a234be151f8ec815948325ab3c9db9d6659e836c750c8890a3'
AND (
token = '0KSsOBm8HPB1g912zXjj19tTVTzUw98mEFocuTeka00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)