does a php script stop running when you receive 504 Gateway Timeout?

I am on a shared server (siteground), and as my php wordpress script takes more than 30 seconds, it returns a 504 gateway timeout. Will my query be executed and terminated, no error occurring?