In this case, I think increasing the timeout time is not a good option.
If the problem and INSERT number, instead of making 34,000 you can do just one:
INSERT INTO example
(example_id, name, value, other_value)
VALUES
(100, 'Name 1', 'Value 1', 'Other 1'),
(101, 'Name 2', 'Value 2', 'Other 2'),
(102, 'Name 3', 'Value 3', 'Other 3'),
(103, 'Name 4', 'Value 4', 'Other 4');
Also, you need to know why you need to do 34,000 INSERT ... If and to solve a DUMP type problem, you can use SQL directly without using PHP.
To respond in Otto's comment, saying that he uses store_procedure,
this:
for ($test=0; $test<10; $test++)
{
$str = "";
for ($w=0; $w < 3400; $w++)
{
$str .= "(".$w.",'Name1','Totpo','Name2'),\n";
}
$str .= "(".$w.",'Name1','Totpo','Name2');";
$query_insert = "
INSERT INTO EXEMPLE
(champ1,champ2,champ3,champ4)
VALUES ".$str;
//echo $query_insert;
$result = sql_query($db_so36,$query_insert);
}
then, 34,000 INSERT, takes only 0.271 sec!