将参数传递给字符串

I have string like this:

SELECT 
    DISTINCT(l.lead_id), 
    l.*, TIMESTAMPDIFF(HOUR, l.added_date, NOW()) as time_elapsed 
FROM 
    leads as l 
WHERE 
    (
        l.name LIKE '%Nastya%' 
        || l.first_name LIKE '%Nastya%' 
        || l.nick_name LIKE '%Nastya%' 
        || l.name_vorname_partner LIKE '%Nastya%'
    ) 
    AND l.is_active = ? 
    AND l.is_archive = ? 
    AND dont_show_in_list=0 
ORDER BY 
    datum_event asc` 

And i have array like this:

Array
(
    [l.is_active] => 1
    [l.is_archive] => 0
)

How can i pass settings l.is_active and l.is_archive to string?