UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tcBhp+G2/eih7VkqH8+Cplg1CbmnqDWaB1RP490h+jc='
WHERE
key_id = '9ee575a4f6195b7ea9cf297b287f0665423ce73f0a0a7c328ff5a96df3f9a0cf'
AND (
token = 'tcBhp+G2/eih7VkqH8+Cplg1CbmnqDWaB1RP490h+jc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)