Hello Pasindu Soysa
According to Microsoft's policy, you can upgrade to Windows Server 2022 for free if you have purchased a license for Windows Server 2019. This means that you can upgrade to Windows Server 2022 with the perpetual license you purchased without paying any additional fees. In addition, you can get the key again from the same perpetual license loaded by the same customer to upgrade to Windows Server 2022 if needed. Note that this only applies to perpetual licenses, not subscription licenses.
Hope it helps.
Kind regards,
Lei