UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FXESFb4p3uPec7gX4wgF/Pz9G4s7pF3GEZtlLl2Fq9M='
WHERE
key_id = '9ec2878f0962197cd8c3d09d96cc6bc9d2b358aca2d7fd08fbd990c4a8e65bb2'
AND (
token = 'FXESFb4p3uPec7gX4wgF/Pz9G4s7pF3GEZtlLl2Fq9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)