S3 L2 LST masking and subsetting

I want to subset and reproject S3 L2 SLSTR images, and I wrote a python script. Part of the code is below. Before subsetting I want to apply the mask “not cloud_in_visible && not cloud_in_thin_cirrus && LST_uncertainty < 0.182”.
subset_op = snappy.jpy.get_type(‘org.esa.snap.core.gpf.common.SubsetOp’)()
subset_op.setSourceProduct(in_product)
subset_op.setGeoRegion(WKTReader().read(in_geom_wkt))
subset_op.setBandNames([in_band])
target_op = subset_op.getTargetProduct()

reproject_op = snappy.jpy.get_type("org.esa.snap.core.gpf.common.reproject.ReprojectionOp")()
reproject_op.setSourceProduct(target_op)
reproject_op.setParameter("crs","EPSG:3857")
reproject_op.setParameter("resampling", "Nearest")
reproject_p = reproject_op.getTargetProduct()
ProductIO.writeProduct(reproject_p, out_file, "GeoTIFF-BigTIFF")

Can someone post an example for masking the pixels from a product before subsetting and reprojection?
I found the code for applying the mask on a band, but at the end I don’t know how to subset and reproject the band.
# band = target_op.getBand(in_band)
# band.setValidPixelExpression(‘not cloud_in_visible && not cloud_in_thin_cirrus && LST_uncertainty < 0.182’)
# band.getValidMaskImage()
Thank you,