I believe that airport security staff are authorized to open and check your luggage at anytime during your trip if or when they feel that your luggage looks suspicious or it may contains things that make the luggage looks suspicous. However, after checking it, they have to leave a note in your luggage to let you know that they have gone thru your luggage for that security purposes and everything should be put back the way it should be. So, locking your luggage will not be a good ideal in for that instance. The lock itself sometimes might create suspicion.
locking your luggage