Somewhat imperfect comparison: in Windows, you can simply press Win+L to lock Windows.
Is there a similar keyboard shortcut in Android?
You could type in "adb shell input keyevent 26" which in turn will lock your screen
For this you need the usb debugging enabled on your phone and adb should be installed in your machine
A complete adb installer in 15 seconds for windows can be found here
And for Linux Machine there is a script which is written by Corbin Davenport. just execute below given line without the quotes in any Linux terminal to install
Hope this helps you although this is not a shortcut key