SELECT 
 * 
 
FROM 
 `page` 
 
WHERE  
  IF( :name<>'', `name` = :name, true )
 AND 
  IF( :grid<>'', `grid` = :grid, true )
  
LIMIT 
 1 
 
OFFSET 
 0
 
