First, apply the mid latitude mask as mask
.
Next, add envelopes for each of the C-CAP sources as masks (otherwise chunky pixels sneak in, per mojodna/marblecutter-land-cover#6):
update land_cover set mask = ST_Union(mask, (select ST_Union(ST_Envelope(geom)) from land_cover where source='C-CAP')) where source='ESACCI-LC Mid Latitudes';
Then, update the footprint to exclude the mask (to ensure that appropriate sources are selected):
update land_cover set geom=ST_Multi(ST_Difference(geom, mask)) where source='ESACCI-LC Mid Latitudes';