The easiest way is to terrain correct both the coherence and the displacement raster and stack them to have both of them in the same product.
Afterwards you can define a valid pixel expression for the displacement in the raster properties using the coherence band to set a threshold (e.g. coherence > 0.3). This will mask out all pixels with lower coherence than the defined threshold.
Some notes on this: Combine coherence and displacement bands?
If you want to use the masked raster outside SNAP, please also consider this point: