Say I have a Lagrangian density with kinetic term $\mathcal{L}_{kin} = \phi \Box \phi$.
To derive the equations of motion, I could integrate by parts to obtain $\mathcal{L}_{kin}' = - (\partial_{\mu}\phi)(\partial_{\mu}\phi)$, then apply the Euler-Lagrange equations to obtain $2\Box\phi=0$. (Correct me if any of this is wrong, but this is the part I believe I understand.)
However, I am interested in how one would go about deriving the same equations of motion directly from $\phi\Box\phi$ without integration by parts. It seems there are two ways to go about it: treat the $\Box\phi$ factor entirely as a function of $\phi$, or entirely as a function of the $\partial_{\mu}\phi$ (or some combination of the two, but let's not overcomplicate things).
In both cases (which should yield equivalent results by the self-consistency of partial derivatives), it seems I get as the equation of motion $\Box\phi = 0$. In other words, I could equivalently treat the $\Box\phi$ as a constant, even though strictly speaking this is not correct. However, this equation differs by a factor of 2 from the other one. This would not be an issue if we just had the kinetic term, but it seems to me this could lead to problems if there were other terms in the Lagrangian, as now the relative scaling of terms could be different based on whether one does integration by parts or not.
What am I missing here? I imagine my misunderstanding has something to do with what occurs in the guts of the calculations $\frac{\partial}{\partial(\partial_{\mu}\phi)}\Box\phi$ and $\frac{\partial}{\partial\phi}\Box\phi$. Are these both 0, as I believe, or is the result more complicated?