Hi IT MRZK,
each version of Windows Server requires its own specific license, so a Windows Server 2022 license would not work for a Windows Server 2019.
However, you could consider upgrading to Windows Server 2022 if your hardware and software requirements (Perform an in-place upgrade of Windows Server | Microsoft Learn) allow for it.
Hope it helps.
Best regards,
Lei