It obviously depends on intensity, and is sometimes described as reverse J-curve[1] relationship. Moderate exercise helps, while intense exercise diminishes these benefits and might also increase mortality risk.
[1] https://pubmed.ncbi.nlm.nih.gov/32848273/