UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Iq58Yvvjt25lwgX4By7pZO+XhMW+A/E1FhPRAMce+2I=' 
WHERE 
  key_id = '0b11a972bf34a08ad3bc8b032f22c790768ab7295ec2b8e4614bfa759fe8c793' 
  AND (
    token = 'Iq58Yvvjt25lwgX4By7pZO+XhMW+A/E1FhPRAMce+2I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032