UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nN4TT9pgyUHrA/ZYoHVz8oWEoXaxAsUj3KA2dB0CeoY='
WHERE
key_id = '4e667b63c5a9d496157c6e074af6ce4f30f3bac573ca8b9882e8650b9d2495c7'
AND (
token = 'nN4TT9pgyUHrA/ZYoHVz8oWEoXaxAsUj3KA2dB0CeoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)