UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'it6Pcl+Qo1CeOwX3EI0cJyk68MIbX1Pl88a8COIjMzc=' 
WHERE 
  key_id = 'e0853c886f64ceb85afccb0de6ae101d6ef2500dfcc9180a2103d26498d04acf' 
  AND (
    token = 'it6Pcl+Qo1CeOwX3EI0cJyk68MIbX1Pl88a8COIjMzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020