Removing backticks from MySQL queries. Replacing by brackets when needed