In memcached, there is no lock per se, but there are CAS operations. With these, you'd see the failure of one of two actors trying to do a set at the same time. One would succeed, the other would fail. Frequently that'll solve what you need.
Also, note that the Couchbase Java Client which extends this client does have a get with lock and unlock. Still, if you can work your logic in to use CAS, you'll be better off.