For example, I lock some rows:
select * from t1 where c2 = 1 for update;
c2 is not indexed. It means MySQL has to search entire table and if it read uncommitted or read committed isolation levels it places locks on every scanned row and if it doesn't satisfy the WHERE condition it immediately release the lock.
If it is repeatable read those locks that do not satisfy the WHERE condition remain until the end of the transaction.
When MySQL searchs indexed column for some reason it doesn't place locks on rows that do not satisfy the WHERE condition. Yes, it uses another algorithm which allows it to find the row in 3-4 fetches but it still touches some rows before it find correct one.