UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gIyThAHbI5WgUEwilRiI2IQiuxw9FdKX//Nj9kstJ7c=' 
WHERE 
  key_id = 'f9b84ae454ee099e29de2781c22541f32c63a908d8e6bb5acb27f5df22589d9b' 
  AND (
    token = 'gIyThAHbI5WgUEwilRiI2IQiuxw9FdKX//Nj9kstJ7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030