UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uyy1phRJYx32/Yd9Sjxa9t7IiLcGGe2YGuqKxp344Uc=' 
WHERE 
  key_id = 'b3a753d152b518c0b0b28b68059d0056d6a9ce76b70f072663197f64f7f27b7e' 
  AND (
    token = 'Uyy1phRJYx32/Yd9Sjxa9t7IiLcGGe2YGuqKxp344Uc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033