You can implement locking and unlocking using the custom table with column lock with true or false. For example if user1 claim the task then you have insert true to column. if another user claim the same task then you have to again query the same table and see if true then show task claim by other user else open the task.