UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J01pi/SrIYI3M6fyfAlojg4OzzjTKZfAAPDSj3lYAps=' 
WHERE 
  key_id = '4e6dd936c6acaa1ee28ca8b2cfef0db75fa866829f42a68eab3d32e850e93c81' 
  AND (
    token = 'J01pi/SrIYI3M6fyfAlojg4OzzjTKZfAAPDSj3lYAps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029