I'm trying to calculate the variance $\mathrm{var}\left(\log\frac{S\left(t\right)}{S\left(0\right)}\right)$, where the dynamics of the stock $S$ follows a jump-diffusion process given by $$\frac{dS\left(t\right)}{S\left(t-\right)} = \left(\alpha-\lambda \kappa\right)dt+\sigma dZ\left(t\right)+\left(Y\left(t\right)-1\right)dN\left(t\right),$$ where the jumps are driven by an independent Poisson process $N\left(t\right)$ with constant intensity $\lambda$ and random jump size $Y$, and the jump sizes are lognormally distributed with parameters $\mu\left(t\right)$ and $\delta\left(t\right)$. $\kappa = E\left(Y\left(t\right)-1\right)$ is the expected relative jump of $S\left(t\right)$.
If $\mu\left(t\right)=\mu$ and $\delta\left(t\right)=\delta$, this is just a regular Merton jump-diffusion model, and e.g. Navas (2003) shows that the variance is $$\begin{align}\mathrm{var}\left(\log\frac{S\left(t\right)}{S\left(0\right)}\right) &=\mathrm{var}\left(\sigma Z\left(t\right)\right) + \mathrm{var}\left(\log Y\left(n\left(t\right)\right)\right) \\ &= t \sigma ^2 + t \lambda \left(\mu^2 + \delta^2 \right),\end{align}$$ because the Poisson process is independent of the diffusion.
I'm trying to calculate this quantity if the jump sizes and volatilities are not constant and, instead, are both functions of time $t$, as discussed above. I've been following Navas's derivation: $$\begin{align}\mathrm{var}\left(\log Y\left(n\left(t\right)\right)\right) &= -E \left(\log Y\left(n\left(t\right)\right)\right)^2 + E \left(\left(\log Y\left(n\left(t\right)\right)\right)^2\right) \\ &= -\left(\lambda\int \mu\left(t\right) dt \right)^2+ E \left(\left(\log Y\left(n\left(t\right)\right)\right)^2\right), \end{align}$$ but I'm stuck on the last expectation. Would anyone be able to help, please?
EDIT (after bountying this): the functions $\mu\left(t\right)$ and $\sigma\left(t\right)$ are, in my example, piecewise functions in the style of $$\mu\left(t\right) = \begin{cases} \mu_1, & 0 < t \leq 1 \\ \mu_2, & 1 < t \leq 2 \\ \vdots & \vdots \\ \mu_T, & T-1 < t \leq T. \end{cases}$$
Reference:
Navas, Javier F., Calculation of Volatility in a Jump-Diffusion Model. Journal of Derivatives, Vol. 11, No. 2, 2003, Available at SSRN: https://ssrn.com/abstract=1031196