Shaving with stone razors was technologically possible from Neolithic times, but the oldest portrait showing a shaved man with a moustache is an ancient Iranian (Scythian) horseman from 300 BC.
Various cultures have developed different associations with moustaches.