You never know when someone might stab you in the back.

Literal

When throat-slit-in-sleep understood thing [copula-ではありません].

寝首を掻く 'to slit someone's throat while they sleep' — an idiom for betrayal or a surprise attack. いつ…かわかったものではない 'there's no telling when' expresses unpredictable danger. The passive 掻かれる makes the speaker the potential victim.