UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mG4gVGRGhFUPR0hkRqCokhAmAu6fvXsNQzkbG7BXVDM='
WHERE
key_id = '2f6a5eeb07c9639aeac4647280094a9e808fc0fc1ab49b95af39f3937f82bc6b'
AND (
token = 'mG4gVGRGhFUPR0hkRqCokhAmAu6fvXsNQzkbG7BXVDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)