I have simple query
UPDATE `local-cadastre` SET `name` = :district_name WHERE `id` = :uniq_id
But this query is repeated about 24000 times in foreach cycle, it works good but browser displays 504 Gateway Timeout error, is it possible to avoid this?