UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u7do/IhMh/kr5MOxeZ8armoNejFl3kiE9Q1CkhDYE0I='
WHERE
key_id = '1ac38ee2d0f1bf6d6e2bfc0b3757c60f79bc6ff8a51458f345d29009ad89eab7'
AND (
token = 'u7do/IhMh/kr5MOxeZ8armoNejFl3kiE9Q1CkhDYE0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)