We are developing a framework for computation with biochemical reactions with a focus on synthesizing specific logical functionality, a task analogous to technology-independent logic synthesis. Our method synthesizes biochemical reactions that compute output quantities of molecular types as a function of input quantities, either deterministically or probabilistically. An important constraint is the timing, captured in the relative rates of the biochemical reactions: all the outputs of a given phase must be produced before the next phase can begin consuming them as inputs. To achieve this synchronization, the reaction rates must sometimes be separated by orders of magnitude: some much faster than others, some much slower. This might be costly or infeasible given a specific library of biochemical reactions. In this paper, we describe a novel mechanism for locking the computation of biochemical modules - analogous to handshaking mechanisms in asynchronous circuit design. With locking, our method synthesizes robust computation that is nearly rate independent, requiring at most two speeds ("fast" and "slow"). The trade-off is with respect to the size of the solution: more reactions are needed. We characterize this trade-off for inter-and intra-module locking in general and for a variety of specific modules that we have designed. In particular, we discuss locking in detail for a stochastic module that implements probabilistic computation, producing different combinations of molecular types according to specified probability distributions.