The duration of 2.3 second for the query suggests that you have a large volume of data. It is quite common to increase the maximum execution time for large data merging.
But you can also try to check for optimization in your template.
See the FAQ: The merge is too slow.