On B and L violation in the laboratory in the light of cosmological and astrophysical constraints