Here I would like to mention the notion of quasi-symmetry. In general, if the Lagrangian (resp. Lagrangian density resp. action) is only invariant up to a total time derivative (resp. space-time divergence resp. boundary term) when performing a certain off-shell$^1$ variation, one speaks of a quasi-symmetry, see e.g. Ref. 1.
Noether's first Theorem does also hold for quasi-symmetries. For examples of non-trivial conservation laws associated with quasi-symmetries, see examples 1, 2 & 3 in the Wikipedia article for Noether's theorem.
References:
- J.V. Jose & E.J. Saletan, Classical Dynamics: A Contemporary Approach, 1998; p. 565.
--
$^1$ Here the word off-shell means that the Euler-Lagrange (EL) eqs. of motion are not assumed to hold under the specific variation. If we assume the EL eqs. of motion to hold, any variation of the Lagrangian is trivially a total derivative.
The Lagrangian (and the action as a whole)
$$ L = \frac{1}{2}m \dot{q}^2 - \ln t$$
is not invariant under the transformation given by
$$T = t, \qquad Q = 0.$$
The rescaling of $t$ by factor $1+\epsilon$ also modifies the time derivatives:
$ \delta \dot{q} = -\epsilon \dot{q}$ (and the measure of integration $dt$), so the suggested quantity is not conserved.
Where is my error?
So, the error is in choosing the wrong Lagrangian / transformation.
Noether's theorem works just fine for explicitly time dependent Lagrangians.
Here is another example of Lagrangian with explicit time-dependence:
$$
L = \frac{m \dot{q}^2}{2} e^{\alpha t}.
$$
Such type of Lagrangian could arise for example, if we try to obtain the equations of motions for dissipative system.
The Euler-Lagrange equation for this system after omitting common factor reads as
$$
\ddot{q} = -\alpha \dot{q}.
$$
This Lagrangian is invariant under the infinitesimal transformation:
$$
t\to t' = t + \epsilon, \qquad q \to q' = q -\epsilon\frac{\alpha q}{2}.
$$
Substituting these $T$ and $Q$ in the Noether's theorem we obtain the quantity
$$
A=\frac{m }{2} e^{\alpha t}\cdot (\dot{q}^2 + \alpha \dot{q} q).
$$
Its time derivative is
$$
\dot{A} = \frac{m }{2} e^{\alpha t}\cdot (\alpha \dot{q}^2 + \alpha^2 \dot{q} q +2 \ddot{q}\dot{q} + \alpha \ddot{q} q + \alpha \dot{q}^2) ,
$$
If we use E-L equation to eliminate $\ddot{q}$ we obtain $\dot{A}=0$, so the quantity is conserved as it should be.
Best Answer
ACuriousMind has already pointed out in comments the crucial point: $z_0$ is an external parameter, not an dynamical variable of the action $S[x,y,z]$.
OP then ponders in a comment what happens if we artificially promote $z_0$ to a dynamical variable of the action $S[x,y,z,z_0]$? Nevermind this possibly does not make physical sense. What would be the mathematical consequences for Noether's theorem?
OK, let's investigate. The translations $$ z ~\longrightarrow ~ z+\alpha, \qquad z_0 ~\longrightarrow ~ z_0+\alpha $$ is indeed an exact off-shell symmetry of the action $S[x,y,z,z_0]$. Noether's theorem then therefore states that the corresponding Noether charge $$p_z~:=~\frac{\partial L}{\partial \dot{z}}$$ is conserved on-shell $$ \frac{dp_z}{dt}~\approx~0. $$ [Here the $\approx$ symbol means equality modulo eom.]
Only trouble is that the eom for $z_0$ reads $$ 0~\approx~\frac{\delta S}{\delta z_0}~=~mg, $$ i.e. if we want to put the system on-shell, we would have to turn off gravity! And then $p_z$ would be conserved on-shell. Therefore Noether's theorem is not violated.