Something like this might do the trick. This will cancel the lock action if the lock is already locked, whether or not the door is open.
And others will not doubt come along with other suggestions. There are always more than one way to do something.
To cancel an action, first make the delayed action cancellable by turning on the "cancel" switch in the action. Note this doesn't cancel anything, it just means that the action can be cancelled. Use the "Cancel delayed actions" to actually cancel it.
Trigger:
Lock *changed*
Actions:
IF lock unlocked THEN
IF door closed
lock: lock --> delayed 0:10:00 (cancel)
ELSE
send notification
END-IF
ELSE
Cancel delayed actions
END-IF
Did you check on in your lock's settings if auto-lock timeout is turned on? Both of my Yale locks have that feature and the locks would lock themselves after a few minutes regardless of what the hub was directing them to do.