UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iWKbxFuAhzrrz7Nrgqvd3ZjAxE3tABuaSpc3KHf3SCE='
WHERE
key_id = '3c9d139a40b955520be7855e69947dd35d07e8254bc3b4b4419c16b4226e5586'
AND (
token = 'iWKbxFuAhzrrz7Nrgqvd3ZjAxE3tABuaSpc3KHf3SCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)