There are ways to cram relativity into this formalism, but they're awkward, convoluted, and rarely used.
The much more common approach is to replace the Lagrangian with a Lagrangian density - a functional on fields $\mathcal{L}(\partial_\mu \varphi, \varphi, x, t)$, where $\partial_\mu \varphi$ denotes a partial derivative of the field $\varphi(x, t)$ with respect to the variable $\mu$, which ranges over $x, y, z,$ and $t$. The Lagrangian density is a Lorentz-scalar field and therefore Lorentz-invariant. In principle, the Lagrangian $L(t)$ itself is a spatial integral of the Lagrangian density ($L(t) = \int d^3x\ \mathcal{L}(x, t)$), and the action $S$ is the time integral of the Lagrangian as usual ($S = \int dt\, L(t)$). But the Lagrangian $L$ is frame-dependent, so in practice it's much nicer conceptually to go right from the Lagrangian density to the action by integrating over spacetime ($S = \int d^3x\ dt\ \mathcal{L}(x, t)$) - it turns out that this integral is Lorentz-invariant. So everything is expressed in terms of local, Lorentz-covariant fields, and space and time derivatives and integrals are treated on equal footing.
For example, a common Lagrangian density for a relativistic scalar field $\varphi(x, t)$ is
$$ \mathcal{L}(\partial_\mu \varphi, \varphi) = \frac{1}{2} \sum_{\mu = x, y, z, t} \partial_\mu \varphi \partial^\mu \varphi - \frac{1}{2} m^2 \varphi^2.$$
In relativistic quantum field theory, the excitations of this scalar field correspond to particles with a mass given by the parameter $m$.