Use Add swipe to unlock feature of ASUS Cover to prevent such cases.
[ASUS Cover for ZenFone 3]
You can add swipe to unlock directly on cover view. Swipe to Quick settings, then tap Unlock.
[ASUS Cover for ZenFone 2]
Launch Settings > ASUS Cover then check "Add swipe to unlock cover".
Note: If you use a non-official cover accessory, some functions may not work properly. Check out the official ASUS website to see the latest ASUS official cover accessory.