In general, snot / mucus exists to flush out any inhaled irritants / infectants from your nasal cavity.
But coronavirus is not inhaled, it's spread through droplet contact so you're more likely to get it by touching your nose, face, eyes, mouth, things you eat, whatever.