Since you asked, yes, optical flip-flops have been around for decades.
That said, you don't need flip-flops or latches to calculate SHA-256 for mining Bitcoins. You only need them at the edges of the circuit, to use the results. But you can do that with electronics at the edge, if you want to avoid stateful logic in the all-optical part.