UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UrhvPWn7cwjxLJNAv2Q6O6vkq2sfjvEvEROuIHSk1hg=' 
WHERE 
  key_id = '0204496310ce8d71f804893fc762b0028363a60c2cbd8f591612a2421641fbc4' 
  AND (
    token = 'UrhvPWn7cwjxLJNAv2Q6O6vkq2sfjvEvEROuIHSk1hg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035