I'm going out on a limb and assuming that it's not just an array of 2 items, and you want to scale this up. This should work for two items (and more) though.
$returnStr = "";
$i = 0;
while ($i < count($array)){
$returnStr .= $array[$i] . "=" . $array[$i] . "+y" . (($i+1 < count($array))?" AND ":"");
$i++;
}
echo $returnStr;