An advanced photodynamic molecular beacon (PMB) was designed and synthesized, in which a distyryl boron dipyrromethene (DSBDP)-based photosensitizer and a Black Hole Quencher 3 moiety were connected via two peptide segments containing the sequences PLGVR and GFLG, respectively, of a cyclic peptide. These two short peptide sequences are well-known substrates of matrix metalloproteinase-2 (MMP-2) and cathepsin B, respectively, both of which are overexpressed in a wide range of cancer cells either extracellularly (for MMP-2) or intracellularly (for cathepsin B). Owing to the efficient Förster resonance energy transfer between the two components, this PMB was fully quenched in the native form. Only upon interaction with both MMP-2 and cathepsin B, either in a buffer solution or in cancer cells, both of the segments were cleaved specifically, and the two components could be completely separated, thereby restoring the photodynamic activities of the DSBDP moiety. This PMB could also be activated in tumors, and it effectively suppressed the tumor growth in A549 tumor-bearing nude mice upon laser irradiation without causing notable side effects. In particular, it did not cause skin photosensitivity, which is a very common side effect of photodynamic therapy (PDT) using conventional “always-on” photosensitizers. The overall results showed that this “double-locked” PMB functioned as a biological AND logic gate that could only be unlocked by the coexistence of two tumor-associated enzymes, which could greatly enhance the tumor specificity in PDT.