Let us look at the first term in your Lagrangian:
$$\partial_\mu \phi \partial^\mu \phi$$
Now, for a general derivative $ \partial_x $ we have:
$$\partial_x \left(y \partial_x y\right) = (\partial_x y)^2 + y \partial^2_x y$$
$$\Rightarrow (\partial_x y)^2 = \partial_x \left(y \partial_x y\right) - y \partial^2_x y$$
If you substitute the above for $\partial_\mu \phi \partial^\mu \phi$ in your Lagrangian, you get two terms, one of which is of the form $\partial_\mu (...)$. This term is a total derivative and does not contribute to the equations of motion. This is because in the action,
$$S = \int d\vec{x} dt L$$
the total derivative term will integrate out to give constant. And when we calculate equation of motion, that constant will be differentiated to zero.