How to lock screen OSX without setting “immediately” in Security & Privacy settings
The Keychain Access App is located in the Utilities subfolder of the Applications folder.

In the Keychain Access App, open Preferences and under the General tab you can tick the box Show Keychain status in menu bar. It'll put a padlock symbol that's resident in your menu bar that when clicked will provide you with a menu, the first menu item is Lock Screen. After setting the preference you can exit the Keychain Access App.

You can select the menu item to lock your screen.