Long mysql select that affect whole site performance

Because of mysql statement lower(t1.sku) = lower(sku) search becamse impossibly long. If several users made this search whole site becomes slow and blocks metatada of product and other table. In order to fix:
atrocore-legacy/app/Espo/Core/SelectManagers/Base.php: 2140 removed unnecessary where conditions like t1.id left t1.sku and t1.name

Query from here vendor/doctrine/dbal/src/Connection.php:837 removed lower from query
with this content:
SELECT t1.id AS atro_id, t1.assigned_user_id AS atro_assigned_user_id, t1.created_by_id AS atro_created_by_id,
t1.name AS atro_name, t1.catalog_id AS atro_catalog_id, catalog_mm.name AS atro_catalog_name,
t1.sku AS atro_sku, t1.is_active AS atro_is_active, t1.data AS atro_data,
t1.sort_order AS atro_sort_order, hierarchy_alias_z68905b70ed72873f.parent_id AS atro_parent_id,
alias_s68905b70ed72a495.name AS atro_parent_name

FROM product t1

LEFT JOIN catalog catalog_mm ON t1.catalog_id = catalog_mm.id and catalog_mm.deleted = 0
LEFT JOIN product_hierarchy hierarchy_alias_z68905b70ed72873f ON t1.id=hierarchy_alias_z68905b70ed72873f.entity_id AND hierarchy_alias_z68905b70ed72873f.deleted=0
LEFT JOIN product alias_s68905b70ed72a495 ON alias_s68905b70ed72a495.id=hierarchy_alias_z68905b70ed72873f.parent_id AND hierarchy_alias_z68905b70ed72873f.deleted=0

WHERE (LOWER(t1.name) LIKE LOWER(‘NNNNNN%’) OR LOWER(t1.sku) LIKE LOWER(‘NNNNNN%’)) AND t1.deleted = 0 ORDER BY t1.name ASC LIMIT 50