UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zpqHMxUNryU+SHJ6KfBXYY38HcIrBWmW1/V0KE8SXKw='
WHERE
key_id = '0a66d9b5c5bc022219ba9e2195b98b629ae791aeebfd517b2fd322b3b7a91622'
AND (
token = 'zpqHMxUNryU+SHJ6KfBXYY38HcIrBWmW1/V0KE8SXKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)