I may be wrong and I'm new to blockchain technology but researching and studying daily.
but what you describes sounds like a Smart Contract, as it doesn't executes fully until certain conditions have (or have not) been met.
also, the first half sounds like you could use a ring signature which would require signatures from all parties involved to release tokens (if I understood it correctly)