When a double chest is placed and both sides of the chest have a Lock tag, it stays locked. When one side is unlocked, the entire chest is still locked.
Place down a double chest.
Run this command on both chests: /data merge block x y z
Try to open the chest (should be locked)
Run this command on ONE side of the double chest: /data merge block x y z
Try to open the chest again (stays locked)