Comunque nel caso che dici tu non aspetteresti mai 5 secondi: se la transazione dura 0.2 secondi, aspetti 0.2 secondi. 5 è il massimo. Io metterei 2, se metti 0 GET_LOCK non aspetta nulla e restituisce subito 0. In qualsiasi caso, is_free_lock non ti aiuta