I personally use those commands with the gsconnect GNOME extension and KDE Connect on my Android phone:
Lock 🔗
gdbus call --session --dest org.gnome.ScreenSaver --object-path /org/gnome/ScreenSaver --method org.gnome.ScreenSaver.Lock
Unlock 🔗
loginctl unlock-session && xset dpms force on