New York Election Law contains all kinds of arcane provisions that people challenge in court. One of them is the lockbox. But you can take this to the bank: the lockbox is legal.
The case is Van Allen v. Cuomo, decided on September 17. The lockbox is shorthand for the Election Law rule that says you cannot change your party enrollment within 25 days of the election. This is to prevent "party raiding," when voters enroll with the opposing party to influence or determine the results of a primary election.
Van Allen challenged this time limitation under the Equal Protection Clause after he was told he could not change his party enrollment from "non-enrolled" to the Independence Party at the last minute. The Supreme Court actually resolved this issue in Rosario v. Rockefeller, 410 U.S. 752 (1973), ruling that the delay provision did not violate the right to vote since they still enjoyed the electoral franchise and could have changed their party affiliation earlier.
While the right to vote is fundamental, that does not mean that every restriction is unconstitutional. The courts will uphold "evenhanded restrictions that protect the integrity and reliability of the electoral process itself." Like everything else in constitutional law, this is a balancing test. Van Allen loses because the state's interest in discouraging party raiding and encouraging the participation of new voters outweighs Van Allen's interest in registering with the party of his choice only a few weeks before the election. The Second Circuit (Calabresi, McLaughlin and Livingston) do not think it too much a burden for Van Allen to register earlier in complying with a modest timing requirement. The Court of Appeals has too much class to really tell us what's going on here: if you want to change political parties, get off your duff and do it earlier.