How long is the lock time, and how long is the screen timeout time? If the lock time is a couple of minutes, pressing the power button just turns the screen off, it doesn't lock the phone. Then anything pressing the power button and wiping across the screen can "unlock" it. (If the power switch is going bad, resulting in random "presses", all it takes is swiping the screen to turn it to "unlocked".) Try setting it so there's no lock "time" - it locks when you press the power button.
If it still unlocks after that you probably have a problem with the lock screen. First diagnostic tool - install a different lock screen and see if it still happens.