<?php


$ref = array('123', '654', '555');

$in = '(' . implode(',', $ref) .')';

echo 'SELECT * FROM tabela_itens WHERE ref IN ' . $in;