We know that for a uniformly integrable continuous martingale $M$ there holds the optional stopping theorem for all stopping times: $E[M_T|\mathscr{F}_S]=M_S$ for stopping times $S\leq T$. I'm wondering whether the optional stopping theorem is true for a positive continuous martingale and integrable stopping times.
Consider a positive continuous martingale $M=(M_t)_{t\geq 0}$, and two integrable stopping times $S\leq T$, then do we have $E[M_T|\mathscr{F}_S]=M_S$?
If we don't require the integrability of stoppping times, then it is false. A counterexample is given by the exponential Brownian motion $M_t=\exp\left(B_t-\frac{t^2}2\right)$ and the stopping time $$T=\inf\left\{t\geq0: B_t\leq \frac{t^2}2-\log 2\right\}=\inf\{t\geq0: M_t=1/2\},$$ where we have $T<+\infty$ a.s. and $E[M_T|\mathscr{F}_0]=1/2\neq M_0$. But I cannot figure how to prove that $T\in L^1$.
Related: There is a theorem in Le Gall's Brownian Motion, Martingales, and Stochastic Calculus (Theorem 3.25) states that for nonnegative continuous supermartingale and arbitrary stopping times $S\leq T$, we have $E[M_T|\mathscr{F}_S]\leq M_S$.
Any help would be appreciated.