UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FWl+hEg3xPWVy8dxm1HyzYeBvwdZ5mF6XhlIk1Aj07E=' 
WHERE 
  key_id = 'e236a78eebdee9fa0a814356817083a732b01366a896a76ba07110c573e6a0ad' 
  AND (
    token = 'FWl+hEg3xPWVy8dxm1HyzYeBvwdZ5mF6XhlIk1Aj07E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032