I think it depends on the inspector, but I have seen it in writing that they want the overboard discharge valve itself secured with either a lock or a wire tie. When I had a holding tank (I now have a composting head) I had an eyebolt through a bulkhead nearby so that a padlock would hold the seacock handle in the closed position, and the head went straight into the holding tank. That passed muster during five onboard inspections by the Coast Guard. However, I think you could also secure the Y valve in the deck pumpout position to satisfy the requirement. Here's what it says on the Florida website:
What are the guidelines for Y-valves?
Under federal law, if a boat has a Y valve allowing direct overboard discharge of untreated waste, it must be closed while operating in all inland and coastal waters. It is suggested you use a non-releasable wire tie, lock, or remove the valve handle to secure the device. When you are more than three miles offshore in the ocean, the Y valve may be open allowing direct discharge overboard.
A Y valve may also be found on boats having both a Type I or II MSD and a holding tank. This gives the boater an option to discharge treated waste overboard or to contain it for pumpout later.