Marked as helpful by the asker
Cheapest correct fix is optimistic locking: add a version int column, send it with the save, and update where id = ? and version = ?, incrementing version. Zero rows updated means someone else saved first; show 'this lesson changed, reload'. Real-time co-editing (CRDTs) is a different product.