There are some semi-permanent active codes in Genshin Impact, whereas others, like the 4.1 livestream codes, will only work for 24 hours (and are limited) before they expire.